from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.contrib.auth.decorators import user_passes_test
from books.models import Books


def all_books(request):
    all_books = Books.objects.all()
    return render_to_response("books.html", {'books': all_books})


def book(request, id):
    book = Books.objects.get(id=id)
    return render_to_response("book.html", {'book': book})
